package com.insurance.common.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 用户状态枚举类
 *
 * @version 1.0
 * @date 2020/9/20
 **/
public enum UserStateEnum {

    REAL_NAME("0", "已实名"),
    NOT_REAL_NAME("1", "未实名");

    private String code;

    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    UserStateEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMessage(String code){
        if(!StringUtils.isBlank(code)){
            UserStateEnum[] values = values();
            for(UserStateEnum stateEnum : values){
                if(code.equals(stateEnum.getCode())){
                    return stateEnum.getMsg();
                }
            }
        }
        return "";
    }

}
